import QtQuick 1.1

Image {
    id: img

    sourceSize.height: 480

    MouseArea {
        anchors.fill: parent;

        onPressed: {
            img.parent.backgroundPressed();
        }
    }

    states: [
        State {
            name: "FADEOUT"
            PropertyChanges { target: img; opacity: 0}
        },
        State {
            name: "FADEIN"
            PropertyChanges { target: img; opacity: 1}
        },
        State {
            name: "VISIBLE"
            PropertyChanges { target: img; opacity: 1}
        },
        State {
            name: "HIDDEN"
            PropertyChanges { target: img; opacity: 0}
        }
    ]


    transitions: [       
        Transition {
            to: "FADEIN"
            SequentialAnimation {
                NumberAnimation { target: img; properties: "opacity"; easing.type: Easing.OutQuad; duration: 400; }
                PropertyAction { target: img; property: "state"; value: "VISIBLE" }
            }
        },
        Transition {
            to: "FADEOUT"
            SequentialAnimation {
                NumberAnimation { target: img; properties: "opacity"; easing.type: Easing.InQuad; duration: 400; }
                PropertyAction { target: img; property: "state"; value: "HIDDEN" }
            }
        }
    ]

}
